package com.changcheng.service.Imp;



import com.changcheng.mapper.ArticleMapper;
import com.changcheng.pojo.Article;
import com.changcheng.service.ArticleService;
import com.changcheng.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    ArticleMapper articleDao;


    @Override
    public List<Article> article(Article article, Integer currentPage) {
        List<Article> article1 = articleDao.article(article);

        return PageUtil.startPage(article1,currentPage,10);
    }

    @Override
    public Integer selectItemNum(Article article) {
        return articleDao.selectItemNum(article);
    }

    @Override
    public void add(Article article) {
        articleDao.add(article);
    }

    @Override
    public void update(Article article) {
        articleDao.update(article);
    }

    @Override
    public void delete(Integer id) {
        articleDao.delete(id);
    }
}
